#include<iostream>
#include"head.h"
using namespace std;

Node* Solution(Node* L1, Node* L2) {
	if (L1 == nullptr) {
		return L2;
	}
	else if (L2 == nullptr) {
		return L1;
	}
	else if (L1->data < L2->data) {
		L1->next = Solution(L1->next, L2);
		return L1;
	}
	else {
		L2->next = Solution(L1, L2->next);
		return L2;
	}
}

int main() {
	SqList* sl1 = new SqList();
	SqList* sl2 = new SqList();
	
	Node* node = Solution(sl1->head->next, sl2->head->next);
	int x = node->data;
	cout << x << " ";
	node = node->next;
	while(node != NULL) {
		if (node->data != x) {
			cout << node->data << " ";
			x = node->data;
		}
		node = node->next;
	}
	return 0;
}